package com.shidaimanong.service;

import com.shidaimanong.entity.Blog;
import com.shidaimanong.mapper.BlogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学编程，关注：十代码农
 * 抖音、快手、B站、西瓜视频、今日头条
 */
@Service
public class BlogService {
    @Autowired
    BlogMapper blogMapper;

    public Blog query(int id) {
        return blogMapper.query(id);
    }

    public void add(String title, String content) {
        blogMapper.add(title, content);
    }

    public void modify(int id, String title, String content) {
        blogMapper.modify(id, title, content);
    }

    public void del(int id) {
        blogMapper.del(id);
    }

    public List<Blog> queryAll() {
        return blogMapper.queryAll();
    }
}
